; 硬盘主引导扇区代码

    jmp near start

  mytext db 'L',0x07,'a',0x07,'b',0x07,'e',0x07,'l',0x07,' ',0x07,'O',0x07,\
            'f',0x07,'f',0x07,'s',0x07,'e',0x07,'t',0x07,':',0x07
  number db 0,0,0,0,0

start:
    mov ax, 0x07c0          ; 设置数据段基地址
    mov ds, ax

    mov ax, 0xb800          ; 设置显存段基地址
    mov es, ax

    ; 将数据区的字符串复制到显存中
    cld
    mov si, mytext
    mov di, 0x0000
    mov cx, (number-mytext)/2
    rep movsw

    ; 获取标号number的偏移地址
    mov ax, number

    ; 计算number偏移地址的各个位数
    mov bx, ax
    mov cx, 5
    mov si, 10
digit:
    xor dx, dx
    div si
    mov [bx], dl
    inc bx
    loop digit

    ; 显示各位数字
    mov bx, number
    mov si, 4
show:
    mov al, [bx + si]
    add al, 0x30
    mov ah, 0x04
    mov [es:di], ax
    add di, 2
    dec si
    jns show

    mov word [es:di], 0x0744    ; 'D'

    jmp near $

times 510-($-$$) db 0
                 db 0x55, 0xaa